var fs =        require("fs");
var path =      require("path");

var dirs = fs.readdirSync(path.resolve(__dirname, '../'));
var dist = fs.readdirSync(path.resolve('dist'));

dirs.filter(m => m.endsWith('.scss')).map(m => {
    var js = m.replace('.scss', '');
    dist.forEach(d => {
        if(d.startsWith(js) && d.endsWith('.js')){
            fs.unlink(path.resolve('dist', d), err => {
                if(!err){
                    console.log('unlink done!');
                }
            });
        }
    });
});


